import service from "../utils/request";

export function ListAllFilm() {
    return service({
        url: '/film/listVO',
        method: 'get'
    })
}

export function SearchFilm(name) {
    return service({
        url: '/film/name/' + name,
        method: 'get'
    })
}

export function FindFilmByRegionAndType(region, type) {
    return service({
        url: '/film?region=' + region + '&type=' + type,
        method: 'get'
    })
}

export function FindFilmById(id) {
    return service({
        url: '/film/filminfoandstarVO/' + id,
        method: 'get'
    })
}

export function AddFilmEvaluate(data) {
    return service({
        url: '/fe',
        method: 'post',
        data: data
    })
}

export function FindFilmEvaluateByFId(id) {
    return service({
        url: '/fe?fid=' + id,
        method: 'get'
    })
}

export function GetFilmByPage(time, currentPage, pageSize) {
    return service({
        url: "/film/getFilmByPage?time=" + time + "&currentPage=" + currentPage + "&pageSize=" + pageSize,
        method: "get"
    })
}

export function GetFilmEvaluateRankByPage(currentPage, pageSize) {
    return service({
        url: "/film/getFilmEvaluateRankByPage?time=" + "&currentPage=" + currentPage + "&pageSize=" + pageSize,
        method: "get"
    })
}

export function ViewAtAdd(filmId) {
    return service({
        url: "/film/wyc/?filmId=" + filmId,
        method: "get"
    })
}

export function PageSearchFilm(searchText, selectedOption) {
    return service({
        url: "/film/page?selectedOption=" + selectedOption + "&searchText=" + searchText,
        method: "get"
    })
}

export function getFilmMovie(filmId) {
    return service({
        url: `/movie/${filmId}`,
        method: 'get'
    });
}